package com.pactera.wh.druid.cate.rest;


import com.pactera.wh.druid.cate.po.Category;
import com.pactera.wh.druid.cate.service.CategoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhouchang
 * @since 2020-08-25
 */
@RestController
@RequestMapping("/cate/category")
public class CategoryController {

    private CategoryService categoryService;

    public CategoryController(CategoryService categoryService) {
        this.categoryService = categoryService;
    }

    @GetMapping("/{id}")
    public Object getOne(@PathVariable("id") Long id){
        Category category = this.categoryService.getById(id);
        return category;
    }

}

